﻿using System;
using System.ServiceModel;

namespace WCF.Practice.CustomerHost.Service
{
   [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    public class UserService : IUserService
    {
       
        public string GetName(string originalName)
        {
            //throw new ArgumentOutOfRangeException("test exception");
            //throw new FaultException("test");

            var e=new ArgumentOutOfRangeException("this is test");
            throw new FaultException<ArgumentOutOfRangeException>(e);

            return originalName;
        }

        public User GetUser()
        {
            //throw new ApplicationException("what's this?");

            return new User()
            {
                Age = 10,
                Email = "zyflash@163.com",
                Name = "richie"
            };
        }
    }
}